package net.jeeshop.core.pay.alipay.alipayescow.config;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *版本：3.3
 *日期：2012-08-10
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
	
 *提示：如何获取安全校验码和合作身份者ID
 *1.用您的签约支付宝账号登录支付宝网站(www.alipay.com)
 *2.点击“商家服务”(https://b.alipay.com/order/myOrder.htm)
 *3.点击“查询合作者身份(PID)”、“查询安全校验码(Key)”

 *安全校验码查看时，输入支付密码后，页面呈灰色的现象，怎么办？
 *解决方法：
 *1、检查浏览器配置，不让浏览器做弹框屏蔽设置
 *2、更换浏览器或电脑，重新登录查询。
 */

import com.alibaba.fastjson.JSONObject;
import net.jeeshop.core.pay.overall.OverallConfig;

public class AlipayConfig {
	
	//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
	// 合作身份者ID，以2088开头由16位纯数字组成的字符串
	public static String partner = null;
	// 商户的私钥
	public static String key = null;

	//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
	

	// 调试用，创建TXT日志文件夹路径
	public static String log_path = "D:\\";

	// 字符编码格式 目前支持 gbk 或 utf-8
	public static String input_charset = "utf-8";
	
	// 签名方式 不需修改
	public static String sign_type = "MD5";

	//沙箱环境
//	public static final String ALIPAY_PUBLIC_KEY="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1+s0idj2OlQXSqlMXN3vHjQSjvJhG8XcZyij6FLI0e9zkDNyAzx7IE/NiBElueg3A1jFCxb6LucqaJLzlEfTcx1CmbNlPqiiLWF+pA9VlEI0Hmy4P8q5XZk2qGhKPy9O0EybSR5Bopm0+nimTsTp1W/lIWPYWgXaP9f3M2U0V02C+/dk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m/exSvHzCFCLFITt8MG/QKBgQD2Wq1EWDYgNa4GtBrv/PZFLN7rZTZifd2c7dwndrpP0EgZdk/5oiq6i4UEjRuH6JIv+7gLs8uh1+HU1Sr9wyWMLMZ2Y3ulLcukC3ZZf/q6r1PstGW1UJ6GH8r/M8KToY8KkcM6MzCSY5Wfyr4TUqSRv6y+GmnUFkmYjCVuWdOIxwKBgASS4UwWckwZe5GJyw3fQt0hU2t/yOIEQUHNVx2w2jHdoOwJyCwXHI/GqKWPK+LUBNvr8VuJ+TN7QK7PXQ2KFN+f5HpHWQHY1SU+NHu1O1+Jz1Yp5l0S0YGQ5d0MD50nD0r/kz5f/QGuS9c+RjCkZy090gUkbADkR2lpYWXnuEaFAoGBAMWbfKp6u4fgpyQ3afghCAX69SEKwbIFVjNf1J1PLimBX6QU9BfAjdeuvFcnPPMqicC1gC7a3LeIbFyFVQPSehbTf6pNKEwZzORcUWV/M8Z1hrMzDPaAoXfinrlQcn5rNEr9GwVfNFHoUYeoYAkt3FYQ0uZ2V3dJHWWg3RGEOhrXAoGATc1IuzP/Rf+Q6hwe+KrmKl4ViV0Pr/2NozTGIhBRnGxLsNsdDRmDZZHngX3l2+18GM5PAYXQJXwExkAsJubhwVhoh/mrnVtBWLqHIIuytYviDNGpJKe0TOCSPjWcRqwoLi/jyZymULS5U5OsRCmpTkgFqYd+VayJRDzQM6o4ETg=";
//	public static final String APP_ID = "2016080600182372";
//	public static final String FORMAT ="JSON";
//	public static final String CHARSET ="utf-8";
//	public static final String SIGN_TYPE = "RSA2";
//	public static final String SERVER_URL = "https://openapi.alipaydev.com/gateway.do";
//	public static final String RETURN_URL = OverallConfig.WEB_HTTP + "/jshop/paygate/toSuccess";
//	public static final String NOTIFY_URL = OverallConfig.WEB_HTTP + "/jshop/paygate/alipayResult";

	//支付宝正式环境
	public static final String ALIPAY_PUBLIC_KEY="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArPB53NBAtdULX/1DupbvqqudUr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n1k8B6256de1gfOh0QV2ZjwQKBgQDSaDGBL1n3rWB1O8kTIEOYVflIPoZzMqP8yrsB2ChRWTeJrGqerugF2Vam5ZEM48oQN7ssKS0uEt28A6lww6g4Ijxf6/L7LuKKvMuQaduHtJhF5ZVM5r2GUc96knX5tZcluaBOzO4rEu/Y9GT/Y6arztAXkQ8qKROQSStUew8kMQKBgQCtTx/okHCjSaqkzPnlCNZ6df2Hfys1S6cZDK40I02Av/PuVDxBzeocozEldo6TJR+Jof+E8BxXUPJ1Yx3xwyI4O36CbfOa43b9kCTbk763C7Ecf9QpRUPh+RwqdtbC0EpzsXEcrNfFbN5rZFiuHw0kyK1FIo/8S9vkqJ1Etfl0uwKBgC6h8x7bnMf9ABzbhEQd6X1QyLAPU4MinR/A2tOc0cq9yEZWFUdYIopxUfgpdw1xSu5vO6ec9Kt6ePRbp2kbpCPUyqbDx5WOHZ18HG3EWGhqSTlsmbtyhFzJsv9KiKUwbvBohLQSTVL0nn3qJJxJvL3lV09x0feZJQHchaLypzdxAoGBAI4rtJ9RrjUlf2kGBZHPeDKpjDuVJNrpnsA72MRImZGe5fqC+5N32i936B81bKxk7cQ4MqbZWkZ+zwdhMfVcADxlAdj5XbeYFcrYboP6ZZ8/ZiFc86yPd6pucp6bMn5J5GmYDJRbbf402xj6Do14R43/WbS3L6rmiBLCB5GQPn11AoGADlnyCPvn2ejr0I30nSUetoXTBIQE46UOv+vxVdrhym7bTo22SC79QaWa4GERqMvZu8YbtE9eEdFdIV1Kua3uEVGfd7KOlWSuA8EO/lt2Jfr1WV8neCTUgu+OFD8D9H4JF3DQfZ9XgcjhrggJ2ReDTBqnd6swBnCW89EYkZH/GXg=";
	public static final String APP_ID = "2017071407750165";
	public static final String FORMAT ="JSON";
	public static final String CHARSET ="utf-8";
	public static final String SIGN_TYPE = "RSA2";
	public static final String SERVER_URL = "https://openapi.alipay.com/gateway.do";
	public static final String RETURN_URL = OverallConfig.WEB_HTTP + "/paygate/toSuccess";
	public static final String NOTIFY_URL = OverallConfig.WEB_HTTP + "/paygate/alipayResult";

	public static class BizContent{

		private String out_trade_no = null;
		private String total_amount = null;
		private String body = null;
		private JSONObject jsonObjec = null;

		public void setOut_trade_no(String out_trade_no) {
			this.out_trade_no = out_trade_no;
		}

		public void setTotal_amount(String total_amount) {
			this.total_amount = total_amount;
		}

		public void setBody(String body) {
			this.body = body;
		}

		public String getBizContent(){
			JSONObject object = new JSONObject();
			object.put("product_code", "FAST_INSTANT_TRADE_PAY");
			object.put("passback_params", "merchantBizType%3d3C%26merchantBizNo%3d2016010101111");
			JSONObject objectSon = new JSONObject();
			objectSon.put("sys_service_provider_id", "2088102170239816");
			object.put("extend_params", objectSon);
			if (out_trade_no != null){
				object.put("out_trade_no", out_trade_no);
			}
			if (total_amount != null){
				object.put("total_amount", total_amount);
			}
			if (body != null){
				object.put("body", body);
				object.put("subject", body);
			}
			return object.toJSONString();
		}
	}

	public static class BizContentRefund{

		private String out_trade_no = null;
		private String refund_amount = null;
		private String trade_no = null;

		public void setOut_trade_no(String out_trade_no) {
			this.out_trade_no = out_trade_no;
		}

		public void setTotal_amount(String refund_amount) {
			this.refund_amount = refund_amount;
		}

		public void setTrade_no(String trade_no) {
			this.trade_no = trade_no;
		}

		public String getBizContent(){
			JSONObject object = new JSONObject();
			object.put("refund_reason", "正常退款");
			object.put("out_request_no", "HZ01RF001");
			object.put("operator_id", "OP001");
			object.put("store_id", "NJ_S_001");
			object.put("terminal_id", "NJ_T_001");
			if (out_trade_no != null){
				object.put("out_trade_no", out_trade_no);
			}
			if (refund_amount != null){
				object.put("refund_amount", refund_amount);
			}
			if (trade_no != null){
				object.put("trade_no", trade_no);
			}
			return object.toJSONString();
		}

	}
}
